﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class manage_notice_view : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String id = Request["id"];
            if (id != null)
            {
                String sql = "select id, title, contents, addtime, link, case del_flg when 0 then '不显示' when 1 then '显示' end as del_flg from t_notice where id = " + id.ToString();
                DataRow dataRow = DataBaseOperate_SQLServer.GetDataRow(sql);
                if (dataRow != null)
                {
                    labTitle.Text = dataRow["title"].ToString();
                    labContents.Text = dataRow["contents"].ToString();
                    labAddtime.Text = dataRow["addtime"].ToString();
                }else{
                    Response.Redirect("notice_list.aspx");
                }
            }
            else {
                Response.Redirect("notice_list.aspx");
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Redirect("notice_list.aspx");
    }
}
